home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / !runtime / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-18  |  3.6 KB  |  151 lines  |  [TEXT/R*ch]

  1. #ifndef _config_
  2. #define _config_
  3.  
  4.  
  5. #if defined(__MWERKS__) || defined(THINK_C)
  6. #include "m.h"
  7. #include "s.h"
  8. #else
  9. #ifdef macintosh
  10. #include ":::config:m.h"
  11. #include ":::config:s.h"
  12. #else
  13. #include "../config/m.h"
  14. #include "../config/s.h"
  15. #endif
  16. #endif
  17.  
  18. /* Library dependencies */
  19.  
  20. #ifdef HAS_MEMMOVE
  21. #define bcopy(src,dst,len) memmove((dst), (src), (len))
  22. #else
  23. #ifdef HAS_BCOPY
  24. /* Nothing to do */
  25. #else
  26. #ifdef HAS_MEMCPY
  27. #define bcopy(src,dst,len) memcpy((dst), (src), (len))
  28. #else
  29. #define bcopy(src,dst,len) memmov((dst), (src), (len))
  30. #define USING_MEMMOV
  31. #endif
  32. #endif
  33. #endif
  34.  
  35. #ifndef HAS__SETJMP
  36. #define _setjmp setjmp
  37. #define _longjmp longjmp
  38. #endif
  39.  
  40. /* Signed char type */
  41.  
  42. #if defined(__STDC__) || defined(SIGNED_CHAR_WORKS)
  43. typedef signed char schar;
  44. #else
  45. typedef char schar;
  46. #endif
  47.  
  48. /* Do not change this definition. */
  49. #define Page_size (1 << Page_log)
  50.  
  51. /* Memory model parameters */
  52.  
  53. #if !defined(SMALL) && !defined(SIXTEEN)
  54.  
  55. /* The size of a page for memory management (in bytes) is [1 << Page_log].
  56.    It must be a multiple of [sizeof (long)]. */
  57. #define Page_log 12             /* A page is 4 kilobytes. */
  58.  
  59. /* Initial sizes of stacks (bytes). */
  60. #define Stack_size 32768
  61.  
  62. /* Minimum free size of stacks (bytes); below that, they are reallocated. */
  63. #define Stack_threshold 2048
  64.  
  65. /* Maximum sizes for the stacks (bytes). */
  66.    
  67. #ifdef MINIMIZE_MEMORY
  68. #define Max_stack_size 262144
  69. #else
  70. #define Max_stack_size 1048576
  71. #endif
  72.  
  73. /* Maximum size of a block allocated in the young generation (words). */
  74. /* Must be > 4 */
  75. #define Max_young_wosize 256
  76.  
  77.  
  78. /* Minimum size of the minor zone (words).
  79.    This must be at least [Max_young_wosize + 1]. */
  80. #define Minor_heap_min 4096
  81.  
  82. /* Maximum size of the minor zone (words).
  83.    Must be greater than or equal to [Minor_heap_min].
  84. */
  85. #define Minor_heap_max (1 << 28)
  86.  
  87. /* Default size of the minor zone. (words)  */
  88. #define Minor_heap_def 32768
  89.  
  90.  
  91. /* Minimum size increment when growing the heap (words).
  92.    Must be a multiple of [Page_size / sizeof (value)]. */
  93. #define Heap_chunk_min (2 * Page_size / sizeof (value))
  94.  
  95. /* Maximum size of a contiguous piece of the heap (words).
  96.    Must be greater than or equal to [Heap_chunk_min].
  97.    Must be greater than or equal to [Bhsize_wosize (Max_wosize)]. */
  98. #define Heap_chunk_max (Bhsize_wosize (Max_wosize))
  99.  
  100. /* Default size increment when growing the heap. (bytes)
  101.    Must be a multiple of [Page_size / sizeof (value)]. */
  102. #define Heap_chunk_def (62 * Page_size / sizeof (value))
  103.  
  104.  
  105. /* Default speed setting for the major GC.  The heap will grow until
  106.    the dead objects and the free list represent this percentage of the
  107.    heap size.  The rest of the heap is live objects. */
  108. #define Percent_free_def 30
  109.  
  110.  
  111. #else
  112. #ifdef SIXTEEN                 /* Scaled-down parameters for 16-bit machines */
  113.  
  114. #define Page_log 10
  115. #define Stack_size 32768
  116. #define Stack_threshold 2048
  117.  
  118. #define Max_stack_size 65532
  119. #define Max_young_wosize 256
  120. #define Minor_heap_min 512
  121. #define Minor_heap_max 0x3F00
  122. #define Minor_heap_def 8192
  123. #define Heap_chunk_min 0x400
  124. #define Heap_chunk_max 0x3C00
  125. #define Heap_chunk_def 0x2000
  126. #define Percent_free_def 15
  127.  
  128. #else
  129. #ifdef SMALL                   /* Scaled-down parameters for small memory */
  130.  
  131. #define Page_log 10
  132. #define Stack_size 32768
  133. #define Stack_threshold 2048
  134. #define Max_stack_size 1048576
  135. #define Max_young_wosize 256
  136. #define Minor_heap_min 1024
  137. #define Minor_heap_max (1 << 28)
  138. #define Minor_heap_def 16384
  139. #define Heap_chunk_min (2 * Page_size / sizeof (value))
  140. #define Heap_chunk_max (1 << 28)
  141. #define Heap_chunk_def (126 * Page_size / sizeof (value))
  142. #define Percent_free_def 20
  143.  
  144. #endif /* SMALL */
  145. #endif /* SIXTEEN */
  146.  
  147. #endif /* !defined(SMALL) && !defined(SIXTEEN) */
  148.  
  149.  
  150. #endif /* _config_ */
  151.